// SliderVolumeDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MultiMedia.h"
#include "SliderVolumeDlg.h"
#include "MultiMediaDlg.h"

// SliderVolumeDlg dialog

IMPLEMENT_DYNAMIC(SliderVolumeDlg, CDialog)

SliderVolumeDlg::SliderVolumeDlg(CWnd* pParent /*=NULL*/)
	: CDialog(SliderVolumeDlg::IDD, pParent)
{

}

SliderVolumeDlg::~SliderVolumeDlg()
{
}

void SliderVolumeDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Control(pDX, IDC_SLD_VOLUME, m_SliderVolume);
}


BEGIN_MESSAGE_MAP(SliderVolumeDlg, CDialog)
	ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLD_VOLUME, &SliderVolumeDlg::OnNMReleasedcaptureSldVolume)
END_MESSAGE_MAP()


// SliderVolumeDlg message handlers

BOOL SliderVolumeDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	// TODO:  Add extra initialization here
	m_SliderVolume.SetRange(MAX_RANGE_VOL_SLIDER, MIN_RANGE_VOL_SLIDER);
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void SliderVolumeDlg::OnNMReleasedcaptureSldVolume(NMHDR *pNMHDR, LRESULT *pResult)
{
	// TODO: Add your control notification handler code here
	*pResult = 0;
	CMultiMediaDlg::ShareInstance()->m_nVol = m_SliderVolume.GetPos();
	CMultiMediaDlg::ShareInstance()->MediaVolume(CMultiMediaDlg::ShareInstance()->m_nVol);
}
